package security

import java.util.GregorianCalendar;

class User {
	long id
	
    String username
    String passwordHash
    
	long documentId //es el dni
	String firstName
	String lastName
	GregorianCalendar birthDate
	String email
	
//	
    static hasMany = [ roles: Role, permissions: String ]

    static constraints = {
        username(nullable: false, blank: false, unique: true)
		documentId(nullable: false, unique: true)
		birthDate(nullable: false)
		firstName(nullable: false, blank: false)
		lastName(nullable: false, blank: false)
		email(nullable: false, blank: false, email: true)
    }
}
